#include <stdio.h>
#include <math.h>

int main() {
	double f = 0, c = 0;
	char ty;
	printf("Please enter the original temperature type where C means Celsius and F means Fahrenheit : (C or F) \n");
	scanf("%c", &ty);
	if(ty == 'C') {
		printf("Please enter the Celsius temperature you want to convert: \n");
		scanf("%lf", &c);
		f = c * 1.8 + 32;
		printf("The Fahrenheit equivalent of %lf degrees Celsius is %.2lf degrees Fahrenheit.\n", c, f); 
	} 	
	else if(ty == 'F') {
		printf("Please enter the Fahrenheit temperature you want to convert: \n"); 
		scanf("%lf", &f); 
		c = 5.0 / 9.0 * (f - 32);
		printf("The Celsius equivalent of %lf degrees Fahrenheit is %.2lf degrees Celsius.\n", f, c); 
	}
	else {
		printf("Invalid Input. Please Start the programme again.\n");
	}
	return 0;
}